<template>
  <div class="content">
    <div class="text" v-for="(item,index) in count.result.records.slice(0,10)" :key="index">
      <div style="display:flex;align-items: center;">
        <div class="triangle-right"></div>
        <p class="title">{{item.title}}</p>
      </div>
      <div class="title" style="margin-right: 10px;" :style=" item.pubTime.slice(5,10) == count.result.records[0].pubTime.slice(5,10) ? 'color:#C90A0A' : ''">{{'[' + item.pubTime.slice(5,10) + ']'}}</div>
    </div>
  </div>
</template>

<script setup>
  import { useApi } from '../../utils/api'
  import { onMounted } from 'vue'
  const id = ref('1473499574540349442');
  const breed = '1476451881127518210';
  const { data: count, refresh} = await useApi(`/web/infoCategory/getReportListByIds/${breed}/${id.value}`,{
    params: { current: 1},
  })
  watch(id, () => refresh());
</script>

<style lang="scss" scoped>
  .content{
    width: 100%;
    height: 390px;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    .text{
      height: 34px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      .triangle-right {
        margin: 0 5px;
        width: 0;
        height: 0;
        border-top: 4px solid transparent;    /* 高度的一半（8px / 2） */
        border-bottom: 4px solid transparent; /* 高度的一半（8px / 2） */
        border-left: 6px solid #CCC;         /* 宽度（6px），颜色可自定义 */
      }
      .title{
        color: #222;
        font-size: 14px;
        line-height: 21px;
        white-space: nowrap;
        max-width: 290px;
        text-overflow: ellipsis;
        overflow: hidden;
        cursor: pointer;
      }
    }
  }
</style>